package com.hdax.dmw.user.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hdax.dmw.common.controllers.user.LinkUserControllerApi;
import com.hdax.dmw.common.controllers.user.UserController;
import com.hdax.dmw.entity.user.DmLinkUser;
import com.hdax.dmw.user.service.DmLinkUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class LinkUserController implements UserController, LinkUserControllerApi {

    @Autowired
    private DmLinkUserService linkUserService;
    @Override
    public List<DmLinkUser> linkusers(Long userId) {
        List<DmLinkUser> linkUsers = linkUserService.list(new QueryWrapper<DmLinkUser>().eq("userId", userId));
        return linkUsers;
    }

    @Override
    public DmLinkUser detail(Long userId, Long linkId) {
        return linkUserService.detail(userId, linkId);
    }
}
